import Vue from "vue";
import VueRouter from "vue-router";
import index from "../views/index.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    component: index,
    redirect: "dashboard",
    children: [
      {
        path: "/dashboard",
        name: "dashboard",
        component: () => import("../views/dashboard.vue"),
      },
      {
        path: "/personal",
        name: "personal",
        redirect: "/personal/personMessage",
        component: () => import("../views/personal/personal.vue"),
        children: [
          {
            path: "/personal/attentionNumber",
            name: "attentionNumber",
            component: () => import("../views/personal/attentionNumber.vue"),
          },
          {
            path: "/personal/funNumber",
            name: "funNumber",
            component: () => import("../views/personal/funNumber.vue"),
          },
          {
            path: "/personal/personMessage",
            name: "personMessage",
            component: () => import("../views/personal/personMessage.vue"),
          },
          {
            path: "/personal/videlList",
            name: "videlList",
            component: () => import("../views/personal/videlList.vue"),
          },
        ]
      },
      {
        path: "/video",
        name: "video",
        component: () => import("../views/video.vue"),
      },
      {
        path: "/uploading",
        name: " uploading",
        component: () => import("../views/uploading.vue"),
      },
      {
        path: "/message",
        name: "message",
        redirect: '/message/replyToMine',
        component: () => import("../views/message/message.vue"),
        children: [
          {
            path: "/message/replyToMine",
            name: "replyToMine",
            component: () => import("../views/message/replyToMine")
          },
          {
            path: "/message/aiteMine",
            name: "aiteMine",
            component: () => import("../views/message/aiteMine")
          },
          {
            path: "/message/receivedPraise",
            name: "receivedPraise",
            component: () => import("../views/message/receivedPraise")
          },
          {
            path: "/message/myMessage",
            name: "myMessage",
            component: () => import("../views/message/myMessage")
          },
          {
            path: "/message/systemNotification",
            name: "systemNotification",
            component: () => import("../views/message/systemNotification")
          }
        ]
      },
      {
        path: "/collect",
        name: " collect",
        component: () => import("../views/collect.vue"),
      },
      {
        path: "/history",
        name: " history",
        component: () => import("../views/history.vue"),
      },
      {
        path: "/type",
        name: "type",
        component: () => import("../views/videoClassificationPage.vue"),
      },

    ],
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("../views/register"),
  }
];

const router = new VueRouter({
  routes,
});

export default router;
